<%--
  Created by IntelliJ IDEA.
  User: J.TuTu
  Date: 2021/6/23
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>

<%@page import="java.util.List"%>
<%@page import="com.gpf.service.impl.UserServiceImpl"%>
<%@page import="com.gpf.entity.User"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%
    // 获取绝对路径路径 ,开发项目一定要使用绝对路径，不然肯定出错
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":"
            + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath %>" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>处理找回密码</title>
</head>
<body>
<%
    User user=new User();
    //获取searchPassword.jsp页面提交的账号和密码
    String name=request.getParameter("name");
    user.setName(name);

    UserServiceImpl service=new UserServiceImpl();
    List<User> list=service.selectUser(user);
    request.setAttribute("list", list);
    for(User u:list){
        request.setAttribute("user", u);
        out.print(u);
    }
    if(user!=null){
        //response.sendRedirect("search.jsp");//不传输数据的转发
        request.getRequestDispatcher("search.jsp").forward(request, response);
    }
%>
</body>
</html>
